﻿using System;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;

namespace JacketEmblem.Crane.UnitTests.NUnitExtensions
{
    public class TokenizerTestInfo : DataFileTestInfo
    {
        private string description = string.Empty;
        private string input = string.Empty;
        private object[] output;
        private string[] initialStates;
        private string lastStartTag = string.Empty;
        private bool ignoreErrorOrder;

        [JsonProperty("description")]
        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        [JsonProperty("input")]
        public string Input
        {
            get { return input; }
            set { input = value; }
        }

        [JsonProperty("output")]
        [JsonConverter(typeof(TestInfoPropertyJsonConverter))]
        public object[] Output
        {
            get { return output; }
            set { output = value; }
        }

        [JsonProperty("initialStates")]
        public string[] InitialStates
        {
            get { return initialStates; }
            set { initialStates = value; }
        }

        [JsonProperty("lastStartTag")]
        public string LastStartTag
        {
            get { return lastStartTag; }
            set { lastStartTag = value; }
        }

        [JsonProperty("ignoreErrorOrder")]
        public bool IgnoreErrorOrder
        {
            get { return ignoreErrorOrder; }
            set { ignoreErrorOrder = value; }
        }

        public override string Name
        {
            get { return Description; }
        }

        public override object[] Arguments
        {
            get
            {
                object[] args = new object[] {
                    Input,
                    Output,
                    InitialStates,
                    LastStartTag,
                    IgnoreErrorOrder
                };

                return args;
            }
        }
    }
}
